<!doctype html>
<html ng-app="myApp">
<head>
  <title></title>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
  <link href="../css/index.css" type="text/css" rel="stylesheet" />
  <style type="text/css" >
  </style>
</head>
<body >
<div class="wrapper" >
  <div ng-controller="dataListController" class="dataListController">
    <div class="btnGroup">
      <button class="btn" ng-click="add()">添加</button>
    </div>
    <div class="dataListContainer">
      <ul >
        <li ng-repeat="item in list" >
          <p class="title"><a href="{{item.url}}" target="_blank" >{{item.text}}</a></p>
          <div >

            <img src="{{item.thumb}}" class="thumb" />
            <p class="des">{{item.des}}</p>
            <div class="simpleInfo">
              <span >评论({{item.comments}})</span>
              <span >喜欢({{item.loves}})</span>
              <span >时间({{item.time}})</span>
              <span ><a href="javascript:void(0)" ng-click="edit($index)" >编辑</a></span>
              <span ><a href="javascript:void(0)" ng-click="remove($index)" >删除</a></span>
            </div>
          </div>
        </li>
      </ul>
    </div>
    <div ng-show="isShow" ng-controller="dataFormController" class="dataFormController">
      <form role="form" name="form" class="form" ng-submit="submit()">
        <a href="javascript:void(0)" class="close" ng-click="close(false)">close</a>
        <h2 class="title">添加信息</h2>
        <ul >
          <li >
            <div class="col3" >标题:</div>
            <div class="col7" ><input type="text" required ng-model="formData.text" /></div>
          </li>
          <li >
            <div class="col3" >链接:</div>
            <div class="col7" ><input type="text" required ng-model="formData.url" /></div>
          </li>
          <li >
            <div class="col3" >样图:</div>
            <div class="col7" ><input type="text" required ng-model="formData.thumb" /></div>
          </li>
          <li >
            <div class="col3" >介绍:</div>
            <div class="col7" ><textarea  required ng-model="formData.des"></textarea></div>
          </li>
        </ul>
        <div class="text-center">
          <input ng-disabled="form.$invalid" class="btn" type="submit" value="提交">
        </div>
      </form>
    </div>
  </div>
</div>
<script type="text/javascript" src="../angular模仿/js/angular.js" ></script>
<script type="text/javascript" >
  var app = angular.module('myApp', []);
</script>
<script type="text/javascript" src="js/dataListController.js" ></script>
<script type="text/javascript" src="js/dataFormController.js" ></script>
</body>
</html>